from flask import Flask

"""
系统提供路由正则
@app.route('/user/<username>')  # 字符串
@app.route('/post/<int:post_id>') # 整形
@app.route('/post/<float:post_id>')  # 浮点
@app.route('/post/<path:path>')  # url路径（字符串）
@app.route('/login', methods=['GET', 'POST'])  #
"""

app = Flask(__name__)
# 配置文件
app.config.from_object('settings.DevelopmentConfig')


@app.route('/index/<username>', methods=['GET','POST'])
def index(username):
    print(username,type(username))
    return 'Index'

@app.route('/login/<int:get_id>', methods=['GET','POST'])
def login(get_id):
    print(get_id,type(get_id))
    return 'login'

@app.route('/logout/<float:get_id>', methods=['GET','POST'])
def logout(get_id):
    print(get_id,type(get_id))
    return 'logout'

@app.route('/path/<path:path>')
def path(path):
    print(path,type(path))
    return 'path:url路径'


if __name__ == '__main__':
    app.run(port=56789)
